﻿namespace BlackBox
{
    public class ExecutionEngine
    {
        public static decimal ExecuteAndRealizeTrade(decimal investmentAmount, decimal percentageChange, MarketAction action)
        {
            var multiplier = 1.0m;

            switch (action)
            {
                case MarketAction.Buy:
                    multiplier += percentageChange;
                    break;
                case MarketAction.Short:
                    multiplier -= percentageChange;
                    break;
            }

            return (investmentAmount * multiplier) - investmentAmount;
        }
    }
}
